import http from './http'
// 封装登录 /login
export  const loginApi = (userName,passWord)=>{
    return http({
        url: '/login',
        method:'POST',
        data:{
            userName,
            passWord
        }
    })
}
// 封装获取用户信息 /getUserInfo
export  const getUserInfoApi = ()=>{
    return http({
        url: '/getUserInfo',
        method:'GET'
    })
}
// --------------------------------------- 用户区域 -------------------------------------------
// 获取 http://localhost:7001/getUserList
export  const getUserListApi = ()=>{
    return http({
        url: '/getUserList',
        method:'GET'
    })
}
// 搜索 http://localhost:7001/userSearch title
 export  const userSearchApi = (title)=>{
    return http({
        url: '/userSearch',
        method:'GET',
        params:{
            title
        }
    })
}
// 删除 http://localhost:7001/delUser
 export  const delUserApi = (id)=>{
    return http({
        url: '/delUser',
        method:'delete',
        params:{
            id
        }
    })
}
// 新增 http://localhost:7001/addUser
 export  const addUserApi = (data)=>{
    return http({
        url: '/addUser',
        method:'POST',
        data:{
            ...data
        }
    })
}
// 编辑 http://localhost:7001/editItem

 export  const editItemApi = (data)=>{
    return http({
        url: '/editItem',
        method:'PUT',
        data:{
            ...data
        }
    })
}